LiveChat_Segment
You need the Manage Settings permission to manage Segment.
LiveChat_Segments
- LiveChat_Segments Manage
GET livechat/segments
GET livechat/segments/{id}
POST livechat/segments
PUT livechat/segments/{id}
DELETE livechat/segments/{id}
Model
LiveChat_Segment JSON Format
LiveChat_Segment is represented as simple flat JSON objects with the following keys:
Name | Type | Description |
---|---|---|
alertToType |
string | Allowed values are "department", "agent", "none". |
conditionMetType |
string | Allowed values are "all", "any", "logicalExpression". |
logicalExpression |
string | The logical expression for conditions |
id |
guid | Id of the segment. |
name |
string | Name of the segment. |
isEnabled |
bool | Whether this segment is enabled or not. |
description |
string | Description of the segment. |
color |
string | Color of the segment. |
order |
integer | Order of the segment. |
segmentConditions |
segmentConditions[] | Reference to Segment Condition. |
departmentIds |
array | The list of the segment identifiers, which the department belongs to. |
agentIds |
array | The list of the segment identifiers, which the agent belongs to. |
Segment Condition JSON Format:
Name | Type | Description | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id |
guid | Id of the segment condition. | ||||||||||||||||||||||||||||||||||
segmentId |
guid | Id of the segment which the segment condition belongs to. | ||||||||||||||||||||||||||||||||||
fieldName |
string |
Name of the field.
|
||||||||||||||||||||||||||||||||||
operator |
string | Allowed values are "is", "contains", "notContains", "isMoreThan", "isLessThan", "isNot", "isNotLessThan", "isNotMoreThan", "regularExpression", "isOneOf", "isNotIn", "dateNotEqualTo", "before", "after", "dateEqualTo". | ||||||||||||||||||||||||||||||||||
value |
string | Value of the segment condition. | ||||||||||||||||||||||||||||||||||
order |
integer | Order of the segment condition. | ||||||||||||||||||||||||||||||||||
description |
string | Description of the segment condition. |
Endpoint
Get the list of LiveChat_Segments
GET livechat/segments
Parameters:
Name | Type | In | Required | Description |
---|---|---|---|---|
include |
string | query | no | Allowed values are "segmentCondition", "agent", "department". |
Response:
An array of LiveChat_Segment
Example
Sample Request:
curl https://api15.comm100.io/v4/livechat/segments \
-X
'GET'
\
-H
'Authorization: Bearer {access_token}'
\
Response:
HTTP/1.1 200 OK
Get a single LiveChat_Segment
GET livechat/segments/{id}
Parameters:
Name | Type | In | Required | Description |
---|---|---|---|---|
include |
string | query | no | Allowed values are "segmentCondition", "agent", "department". |
Response:
Example
Sample Request:
curl https://api15.comm100.io/v4/livechat/segments/b797848b-0e86-41ac-b048-d72bd0f075ed \
-X
'GET'
\
-H
'Authorization: Bearer {access_token}'
\
Response:
HTTP/1.1 200 OK
Create a new LiveChat_Segment
POST livechat/segments
Parameters:
Name | Type | In | Required | Description |
---|---|---|---|---|
alertToType |
string | body | no | Allowed values are "department", "agent", "none". |
conditionMetType |
string | body | no | Allowed values are "all", "any", "logicalExpression". |
logicalExpression |
string | body | yes | The logical expression for conditions |
name |
string | body | yes | Name of the segment. |
isEnabled |
bool | body | no | Whether this segment is enabled or not. |
description |
string | body | no | Description of the segment. |
color |
string | body | no | Color of the segment. |
order |
integer | body | no | Order of the segment. |
segmentConditions |
segmentConditions[] | body | no | Reference to Segment Condition. |
departmentIds |
array | body | no | The list of the segment identifiers, which the department belongs to. |
agentIds |
array | body | no | The list of the segment identifiers, which the agent belongs to. |
Response:
Example
Sample Request:
curl https://api15.comm100.io/v4/livechat/segments \
-X
'POST'
\
-H
'Authorization: Bearer {access_token}'
\
-H
'Content-Type: application/json'
\
-D
'{"alertToType":"none","conditionMetType":"all","logicalExpression":"","name":"Segment One","isEnabled":false,"description":"This is Segment One","color":"#339FD9","order":2,"segmentConditions":[{"fieldName":"{!Visitor.Number of visits}","operator":"is","value":"3","order":0,"description":"Segment - Number of visits"}]}'
Response:
HTTP/1.1 201 Created
Update the LiveChat_Segment
PUT livechat/segments/{id}
Parameters:
Name | Type | In | Required | Description |
---|---|---|---|---|
alertToType |
string | body | no | Allowed values are "department", "agent", "none". |
conditionMetType |
string | body | no | Allowed values are "all", "any", "logicalExpression". |
logicalExpression |
string | body | yes | The logical expression for conditions |
name |
string | body | yes | Name of the segment. |
isEnabled |
bool | body | no | Whether this segment is enabled or not. |
description |
string | body | no | Description of the segment. |
color |
string | body | no | Color of the segment. |
order |
integer | body | no | Order of the segment. |
segmentConditions |
segmentConditions[] | body | no | Reference to Segment Condition. |
departmentIds |
array | body | no | The list of the segment identifiers, which the department belongs to. |
agentIds |
array | body | no | The list of the segment identifiers, which the agent belongs to. |
Response:
Example
Sample Request:
curl https://api15.comm100.io/v4/livechat/segments/b797848b-0e86-41ac-b048-d72bd0f075ed \
-X
'PUT'
\
-H
'Authorization: Bearer {access_token}'
\
-H
'Content-Type: application/json'
\
-D
'{"alertToType":"none","conditionMetType":"all","logicalExpression":"","name":"Segment One","isEnabled":false,"description":"This is Segment One","color":"#339FD9","order":2,"segmentConditions":[{"fieldName":"{!Visitor.Number of visits}","operator":"is","value":"3","order":0,"description":"Segment - Number of visits"}]}'
Response:
HTTP/1.1 200 OK
Remove the LiveChat_Segment
DELETE livechat/segments/{id}
Parameters:
No Parameters
Response:
No Content
Example
Sample Request:
curl https://api15.comm100.io/v4/livechat/segments/b797848b-0e86-41ac-b048-d72bd0f075ed \
-X
'DELETE'
\
-H
'Authorization: Bearer {access_token}'
\
Response:
HTTP/1.1 204 No Content